package com.kai.prety;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.Button;

public class MainActivity extends Activity {
	
	private Button bluetooth_button;
	private Button keymouse_button;
	private Button setting_button;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.activity_main);
		
		bluetooth_button = (Button)findViewById(R.id.bluetooth);
		keymouse_button = (Button)findViewById(R.id.keymouse);
		setting_button = (Button)findViewById(R.id.setting);
		
		bluetooth_button.setOnClickListener(new buttonlistener());
		keymouse_button.setOnClickListener(new buttonlistener());
		setting_button.setOnClickListener(new buttonlistener());
	}
	
	private class buttonlistener implements OnClickListener{

		@Override
		public void onClick(View v) {
			// TODO Auto-generated method stub
			
			Intent intent = new Intent();
			
			switch (v.getId()) {
			case R.id.bluetooth:
				intent.setClass(getApplicationContext(), BluetoothActivity.class);
				break;
			case R.id.keymouse:
				intent.setClass(getApplicationContext(), KeyMouseActivity.class);
				break;
			case R.id.setting:
				intent.setClass(getApplicationContext(), SettingActivity.class);
				break;
			default:
				break;
			}
			
			startActivity(intent);
			
		}
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

}
